/**
 * (C)2013 Exlu Corporation. All rights reserved.
 * 文件名 : cn.exlu.wea.tpk.email.TextEmail.java
 * 注意事項   :
 */
package cn.exlu.wea.tpk.email;

import java.util.Date;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

/**
 * @author Mark 
 * @version 1.0.1
 * 2013-2-1
 * TextEmail.java
 */
public class TextEmail extends Email{
    Message createMessage(Session session) throws AddressException, MessagingException{
        MimeMessage message=new MimeMessage(session);
        message.setFrom(new InternetAddress(getSendFrom()));
        message.setRecipients(Message.RecipientType.TO, getSendTo());
        message.setSubject(getSubject());
        message.setSentDate(new Date());
        message.setText(getText());
        return message;
    }
}
